<template>
	<view>
		<view class="index-top"></view>
			<view style="position: relative;z-index: 1;" class="dis-flex-column">
				<view class="mt30 px30">
					<view class="c-000 fs20">{{userInfo.realname?userInfo.realname:userInfo.username}}  {{getLevel()}}合伙人</view>
					<view class="mt20 dis-flex flex-align-center flex-between">
						<view class="fs14 c-000">任职公司：</view>
						<view class="fs14 c-000" v-if="userInfo.rztime">入职：{{userInfo.rztime?userInfo.rztime:''}}</view>
					</view>
					<view v-for="(item, index) in companyList" :key="index"  class="fs14 c-000 mt5">{{item}}</view>
				</view>
				<view class="dis-flex-column flex-align-center">
					<u-image src="/static/images/logo.png" class="mt50" width="500" height="441"/>
					<!-- <view class="fs25 fwb mt15">大楚玖胜</view> -->
					<!-- <u-image src="/static/images/middle-logo-text.png" style="margin-top:-140rpx;" width="350" height="79"/> -->
				</view>
				<view class="mt30 px16">
					
					
					<view class="br10 bg-fff dis-flex flex-center py25" @tap="gofq">
						<u-image src="/static/images/qianyue.png" width="60" height="60"/>
						<view class="fs14 c-666 ml10">发起签约</view>
					</view>
					
					<view class="br10 bg-fff dis-flex flex-center py25 mt10"  @tap="goContract">
						<u-image src="/static/images/qianyue.png" width="60" height="60"/>
						<view class="fs14 c-666 ml10">已签预览</view>
					</view>
					
					
					<!-- <view class="br10 bg-fff dis-flex flex-center py25" @tap="goContract">
						<u-image src="/static/images/qianyue.png" width="60" height="60"/>
						<view class="fs14 c-666 ml10">建资签约合同</view>
					</view>
					<view class="br10 bg-fff dis-flex flex-center py25 mt10" @tap="goContract">
						<u-image src="/static/images/qianyue.png" width="60" height="60"/>
						<view class="fs14 c-666 ml10">法务签约合同</view>
					</view>
					<view class="br10 bg-fff dis-flex flex-center py25 mt10" @tap="goContract">
						<u-image src="/static/images/qianyue.png" width="60" height="60"/>
						<view class="fs14 c-666 ml10">金融签约合同</view>
					</view> -->
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex';
	export default {
		computed: {
			...mapState(['hasLogin', 'userInfo'])
		},
		data() {
			return {
				companyList:[]
			}
		},
		
		//页面相关事件处理函数--监听用户下拉动作
		onPullDownRefresh() {
			setTimeout(() => {
				uni.stopPullDownRefresh();
			}, 1500);
		},
		
		watch: {
		   userInfo: {
		     handler(newVal, oldVal) {
				 if(newVal.company) this.companyList = newVal.company.split('@#');
				 else this.companyList = [];
		     },
		     deep: true
		   }
		},
		
		onTabItemTap(){
			if(!this.hasLogin) this.$api.openWindow('/pages/login/login');
		},
		
		onLoad(option) {
			if(this.hasLogin){
				if(this.userInfo.company) this.companyList = this.userInfo.company.split('@#');
				 else this.companyList = [];
			}
		},

		methods: {
			goContract(){
				if(!this.hasLogin){
					this.$api.openWindow('/pages/login/login');
				}else{
					this.$api.openWindow('/pages/center/contractGroup');
				}
			},
			
			
			gofq(){
				if(!this.hasLogin){
					this.$api.openWindow('/pages/login/login');
				}else{
					this.$api.openWindow('/pages/center/contractTemplete');
				}
			},
			
			getLevel(){
				if(!this.hasLogin) return '';
				if(this.userInfo.group_id == 1) return '初级';
				if(this.userInfo.group_id == 2) return '中级';
				if(this.userInfo.group_id == 3) return '高级';
				return '';
			},
		}
	}
</script>

<style>
	.index-top {
		width: 100%;
		height: 100%;
		background-image: url(~@/static/images/login-bg.png); 
		background-size: 100% 100%;
		position: fixed;
		top: 0rpx;
	}
</style>
